package spt.tasks;

import javax.servlet.*;

public class StartListener implements ServletContextListener {
	private TaskManager tm;

	public void contextInitialized(ServletContextEvent event) {
		tm = new TaskManager();
		tm.addTask(new Weather());
		//tm.addTask(new ExampleTask());
		tm.start();
	}
	
	public void contextDestroyed(ServletContextEvent event) {
		if(tm != null)
			tm.stopThread();
	}
}

